package com.DuoXianCheng.D13;

public class C01 extends Thread{
    @Override
    public void run() {
        while (true) {
            synchronized (C03.lock) {
                if(C03.count == 0){
                    break;
                } else {
                    if(C03.foodFlag == 1){
                        try {
                            C03.lock.wait();
                        } catch (InterruptedException e) {
                            throw new RuntimeException(e);
                        }
                    } else {
                        System.out.println("厨师制作了食物");
                        C03.foodFlag = 1;
                        C03.lock.notifyAll();
                    }
                }
            }
        }
    }
}
